package com.yunhoo.govProcure.bean;

import com.ibatis.dao.client.DaoManager;
import com.yunhoo.base.model.Category;
import com.yunhoo.base.model.Department;
import com.yunhoo.base.model.FinancialProject;
import com.yunhoo.base.model.Organization;
import com.yunhoo.base.model.Person;
import com.yunhoo.checkFlow.db.dao.FlowInfoDao;
import com.yunhoo.govProcure.db.dao.ProcureBudgetEditDao;
import com.yunhoo.govProcure.db.dao.ProcurePlanEditDao;
import com.yunhoo.govProcure.model.CateEditBase;
import com.yunhoo.govProcure.model.CateEditDetail;
import com.yunhoo.sys.db.config.DaoConfig;
import com.yunhoo.sys.util.common.CommonParam;
import com.yunhoo.sys.util.common.LoginParam;
import com.yunhoo.sys.util.common.Null;
import com.yunhoo.sys.util.common.ToolKit;
import java.io.Serializable;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
import javax.faces.model.SelectItem;

@ManagedBean(name = "planEditGovBean")
@SessionScoped
public class ProcurePlanEditBean implements Serializable {

    private final static DaoManager daom = DaoConfig.getDaoManager();
    private static ProcurePlanEditDao planEditDao = (ProcurePlanEditDao) daom.getDao(ProcurePlanEditDao.class);
    private static ProcureBudgetEditDao budgetEditDao = (ProcureBudgetEditDao) daom.getDao(ProcureBudgetEditDao.class);
    private static FlowInfoDao checkDao = (FlowInfoDao) daom.getDao(FlowInfoDao.class);
    //
    private Organization org = null;
    private Integer iyear = 0;
    private List<Integer> yearli = CommonParam.yearListOfInteger();
    private List<SelectItem> selectNameli;
    private List<SelectItem> sessionli = null;
    private Integer isession = 0;
    private Integer isessionFor = 0;
    //
    private CateEditBase base = null;
    private CateEditDetail detail = null;
    private List<CateEditDetail> detailli = new ArrayList<CateEditDetail>();
    private DataModel<CateEditDetail> detailModel = new ListDataModel<CateEditDetail>();
    private boolean addOrUpdate = false;
    private boolean editStatus = false;
    private boolean newBase = false;
    private boolean forButton = false;
    private List<FinancialProject> projList = new ArrayList<FinancialProject>();
    private DataModel<FinancialProject> projModel = new ListDataModel<FinancialProject>();
    private String quality = "";//采购预算资金性质
    private Category cate = new Category();
    private List<String> itemli = new ArrayList<String>();
    private List<CateEditDetail> budgetli = new ArrayList<CateEditDetail>();
    private DataModel<CateEditDetail> budgetModel = new ListDataModel<CateEditDetail>();
    private boolean all = false;
    private boolean budgetall = false;
    private List<CateEditDetail> addli = new ArrayList<CateEditDetail>();
    private List<CateEditDetail> initBudgetli = new ArrayList<CateEditDetail>();
    private boolean detailStatus = false;
    private List<CateEditDetail> list = new ArrayList<CateEditDetail>();

    public ProcurePlanEditBean() {
    }

    public void yearChange() {
        initSession();
    }

    private void initSession() {
        Calendar calendar = Calendar.getInstance();
        int sysYear = calendar.get(Calendar.YEAR);
        int sysMonther = calendar.get(Calendar.MONTH) + 1;
        if (iyear < sysYear) {
            isessionFor = 4;
        } else if (iyear == sysYear) {
            Integer imonth = sysMonther;
            if (imonth >= 1 && imonth <= 3) {
                isessionFor = 2;
            } else if (imonth >= 4 && imonth <= 6) {
                isessionFor = 3;
            } else if (imonth >= 7 && imonth <= 12) {
                isessionFor = 4;
            }
        } else if (iyear - 1 == sysYear) {
            Integer imonth = sysMonther;
            if (imonth >= 10 && imonth <= 12) {
                isessionFor = 1;
            }
        } else if (iyear - 1 > sysYear) {
            isessionFor = 0;
            ToolKit.msgs_err("系统时间错误！");
        }

    }

    private void initStatus() {
        addOrUpdate = false;
        editStatus = false;
    }

    public void initBudgetLi() {
//        Map param = new HashMap();
//        //param.put("orgCode", getCurOrg().getCode().trim());
//        param.put("iyear", iyear);
//        param.put("deptCode", getCurDept().getCode().trim());
//        param.put("perNumber", getCurPer().getCpsn_number().trim());
//        param.put("addSign", "0");
//        CateEditBase budgetbase = (CateEditBase) dao.query(param, "budgetEditGov");
        CateEditBase param = new CateEditBase(true);
        param.setIyear(iyear);
        param.setDeptCode(getCurDept().getCode().trim());
        param.setEditPerCode(getCurPer().getCpsn_number().trim());
        param.setAddSign("0");
        CateEditBase budgetbase = budgetEditDao.queryCateEditBaseByDeptAndPerson(param);
        if (budgetbase != null) {
//            param.put("number", budgetbase.getNumber());
//            param.put("quality", quality);
//            param.put("status", "3");
            //initBudgetli = dao.queryList02(param, "budgetEditGov");
            CateEditDetail param1 = new CateEditDetail();
            param1.setOrgCode(LoginParam.getOrg().getCode());
            param1.setIyear(iyear);
            param1.setNumber(budgetbase.getNumber());
            param1.setQuality(quality);
            param1.setStatus("3");
            initBudgetli = budgetEditDao.queryListCateEditDetailByNumber(param1);
            System.out.println("initBudgetli : " + initBudgetli.size());
        }
    }

    public void queryList() {
        newBase = false;
        if (Null.check(iyear)) {
            ToolKit.msgs_err("请选择年度!");
        } else if (Null.check(isession)) {
            ToolKit.msgs_err("请选择季度!");
        } else if (Null.check(quality)) {
            ToolKit.msgs_err("请选择采购预算资金性质!");
        } else {
            initList();
            initStatus();
        }
    }

    public void query() {
        addli.clear();
        newBase = false;
        if (Null.check(iyear)) {
            ToolKit.msgs_err("请选择年度!");
        } else if (Null.check(isession)) {
            ToolKit.msgs_err("请选择季度!");
        } else if (Null.check(quality)) {
            ToolKit.msgs_err("请选择采购预算资金性质!");
        } else {
            initList();
            initBudgetLi();
            initStatus();
            forButton = true;
        }
        System.out.println("addli : " + addli.size());
    }

    public void initList() {
        System.out.println("isession initList : " + isession);
        try {
//            Map param = new HashMap();
//            //param.put("orgCode", getCurOrg().getCode().trim());
//            param.put("iyear", iyear);
//            param.put("imonth", isession);
//            param.put("deptCode", getCurDept().getCode().trim());
//            param.put("perNumber", getCurPer().getCpsn_number().trim());
//            param.put("addSign", "0");
//            base = (CateEditBase) dao.query(param, "planEditGov");
            CateEditBase param = new CateEditBase(true);
            param.setIyear(iyear);
            param.setImonth(isession);
            param.setDeptCode(getCurDept().getCode().trim());
            param.setEditPerCode(getCurPer().getCpsn_number().trim());
            param.setAddSign("0");
            base = (CateEditBase) planEditDao.queryCateEditBaseByDeptAndPerson(param);
            System.out.println("~~~ base : " + base);
            detailli = new ArrayList<CateEditDetail>();
            if (base != null) {
//                System.out.println("base1:" + base.getNumber());
//                param.put("number", base.getNumber());
//                param.put("quality", quality);
//                detailli = dao.queryList(param, "planEditGov");
                CateEditDetail param1 = new CateEditDetail();
                param1.setOrgCode(LoginParam.getOrg().getCode());
                param1.setIyear(iyear);
                param1.setNumber(base.getNumber());
                param1.setQuality(quality);
                detailli = planEditDao.queryListCateEditDetailByNumber(param1);
                System.out.println("detailli size :" + detailli.size());
            } else {
                String curSession = iyear + "0" + isession;
                newBase = true;
                base = new CateEditBase(true);
                base.setNumber(maxCode());
                //base.setOrg(getCurOrg());
                base.setDeptCode(getCurDept().getCode());
                base.setDataPeriod(curSession);
                base.setEditPerCode(getCurPer().getCpsn_number());
                base.setEditDate(new Date());
                base.setAddSign("0");
            }
        } finally {
            daom.endTransaction();
        }
        detailModel.setWrappedData(detailli);
    }

    public void queryBudgetLi() {
//        Map param = new HashMap();
//        //param.put("orgCode", getCurOrg().getCode().trim());
//        param.put("iyear", iyear);
//        param.put("deptCode", getCurDept().getCode().trim());
//        param.put("perNumber", getCurPer().getCpsn_number().trim());
//        param.put("addSign", "0");
//        CateEditBase budgetbase = (CateEditBase) dao.query(param, "budgetEditGov");
        CateEditBase param = new CateEditBase(true);
        param.setIyear(iyear);
        param.setDeptCode(getCurDept().getCode().trim());
        param.setEditPerCode(getCurPer().getCpsn_number().trim());
        param.setAddSign("0");
        CateEditBase budgetbase = budgetEditDao.queryCateEditBaseByDeptAndPerson(param);
        if (budgetbase != null) {
//            param.put("number", budgetbase.getNumber());
//            param.put("quality", quality);
//            param.put("status", "3");
//            budgetli = dao.queryList02(param, "budgetEditGov");
            List<CateEditDetail> templi = new ArrayList<CateEditDetail>();
            CateEditDetail param1 = new CateEditDetail();
            param1.setOrgCode(LoginParam.getOrg().getCode());
            param1.setIyear(iyear);
            param1.setNumber(budgetbase.getNumber());
            param1.setQuality(quality);
            param1.setStatus("3");
            budgetli = budgetEditDao.queryListCateEditDetailByNumber(param1);
            System.out.println("budgetli1:" + budgetli.size());
            if (!Null.check(detailli)) {
                for (CateEditDetail det : detailli) {
                    for (CateEditDetail li : budgetli) {
                        if (det.getId() == li.getId()) {
                            templi.add(li);
                        }
                    }
                }
            }
            budgetli.removeAll(templi);
            System.out.println("budgetli:" + budgetli.size());
        }
        budgetModel.setWrappedData(budgetli);
    }

    public void queryBudgetList() {
        CateEditBase param = new CateEditBase(true);
        param.setIyear(iyear);
        param.setDeptCode(getCurDept().getCode().trim());
        param.setEditPerCode(getCurPer().getCpsn_number().trim());
        param.setAddSign("0");
        //CateEditBase budgetbase = (CateEditBase) dao.query(param, "budgetEditGov");
        //List<CateEditBase> planbase = dao.queryList03(param, "planEditGov");
        CateEditBase budgetbase = budgetEditDao.queryCateEditBaseByDeptAndPerson(param);
        CateEditBase planParam = new CateEditBase(true);
        planParam.setIyear(iyear);
        planParam.setDeptCode(getCurDept().getCode().trim());
        planParam.setEditPerCode(getCurPer().getCpsn_number().trim());
        planParam.setAddSign("0");
        List<CateEditBase> planbase = planEditDao.queryListCateEditBaseByDeptAndPerson(planParam);
        if (budgetbase != null) {
            CateEditDetail param1 = new CateEditDetail();
            param1.setOrgCode(LoginParam.getOrg().getCode());
            param1.setIyear(iyear);
            param1.setNumber(budgetbase.getNumber().trim());
            param1.setQuality(quality);
            param1.setStatus("3");
            List<CateEditDetail> listd = new ArrayList<CateEditDetail>();
            List<CateEditDetail> planlist = new ArrayList<CateEditDetail>();
            //budgetli = dao.queryList02(param1, "budgetEditGov");
            budgetli = budgetEditDao.queryListCateEditDetailByNumber(param1);
            for (CateEditBase p : planbase) {
                CateEditDetail param2 = new CateEditDetail();
                param2.setOrgCode(LoginParam.getOrg().getCode());
                param2.setIyear(iyear);
                param2.setNumber(p.getNumber().trim());
                param2.setQuality(quality);
                param2.setStatus("3");
                //List<CateEditDetail> plist = dao.queryList04(param2, "planEditGov");//整个计划表中
                List<CateEditDetail> plist = planEditDao.queryListCateEditDetailByNumber(param2);
                planlist.addAll(plist);
            }
            if (!Null.check(planlist)) {
                for (CateEditDetail det : planlist) {
                    for (CateEditDetail li : budgetli) {
                        if (det.getId() == li.getId() && det.getFinancial() >= li.getFinancial()) {
                            listd.add(li);
                        }
                        if (det.getId() == li.getId() && det.getFinancial() < li.getFinancial()) {
                            li.getCate().setCount(li.getCate().getCount() - det.getCount());
                            li.setFinancial(li.getFinancial() - det.getFinancial());
                            li.setOther(li.getOther() - det.getOther());
                        }
                    }
                }
            }
            budgetli.removeAll(listd);//移除已用预算并且金额已用完记录
            System.out.println("budgetli:" + budgetli.size());
            List<CateEditDetail> lid = new ArrayList<CateEditDetail>();
            if (!Null.check(detailli)) {
                for (CateEditDetail det : detailli) {
                    for (CateEditDetail li : budgetli) {
                        if (det.getId() == li.getId()) {
                            lid.add(li);
                        }
                    }
                }
            }
            budgetli.removeAll(lid);//移除本季度已用预算
        }
        budgetModel.setWrappedData(budgetli);
    }

    public void add() {
        if (Null.check(iyear) || Null.check(quality)) {
            ToolKit.msgs_err("请先选择点击查询!");
        } else {
            //queryBudgetLi();
            queryBudgetList();
            if (!Null.check(budgetli)) {
                addOrUpdate = true;
                editStatus = true;
            }
            initList();
        }
    }

    public void update() {
        for (CateEditDetail d : detailli) {
            if (d.isSelected() == true) {
                if (d.getStatus().equals("0") || d.getStatus().equals("2")) {
                    addOrUpdate = false;
                    editStatus = true;
                }
            }
        }
    }

    public void delete() throws SQLException {
        for (CateEditDetail d : detailli) {
            if (d.isSelected() == true) {
                if (d.getStatus().equals("0") || d.getStatus().equals("2")) {
                    //dao.delete(d, "planEditGov");
                    planEditDao.deleteCateEditDetailById(d);
                    ToolKit.msgs_err("删除成功!");
                } else {
                    ToolKit.msgs_err("已提交以及审核通过的不能删除，请重新选择！");
                }
            }
        }
        queryList();
        initStatus();
    }

    public void save() throws SQLException {
        if (!newBase) {
            if (addOrUpdate) {
                checkFor(addli);
                System.out.println("detailStatus1:" + detailStatus);
                if (!Null.check(list) && detailStatus == false) {
                    for (CateEditDetail a : list) {
                        a.setNumber(base.getNumber());
                        a.setCheckNumber("");
                        a.setEditDate(new Date());
                        if (Null.check(a.getProject().getFinCode())) {
                            a.getProject().setFinCode("");
                        }
                        if (!"0".equals(a.getStatus())) {
                            a.setStatus("0");
                        }
                        daom.startTransaction();
                        //dao.insert(a, "planEditGov");
                        planEditDao.insertCateEditDetail(a);
                        if (quality.equals("1")) {
                            //dao.update(a, "planEditGov");
                            planEditDao.updateCateEditDetailById(a);
                        }
                        if (quality.equals("0")) {
                            a.setProjCode("");
                            //dao.update01(a, "planEditGov");
                            planEditDao.updateCateEditDetailById(a);
                        }
                        daom.commitTransaction();
                    }
                    queryList();
                    initStatus();
                    addli = new ArrayList<CateEditDetail>();
                    System.out.println("1******:!!!");
                }
            } else {
                checkFor(detailli);
                System.out.println("detailStatus2:" + detailStatus);
                if (!Null.check(list) && detailStatus == false) {
                    for (CateEditDetail c : list) {
                        if (quality.equals("1")) {
                            //dao.update(c, "planEditGov");
                            planEditDao.updateCateEditDetailById(c);
                        }
                        if (quality.equals("0")) {
                            //dao.update01(c, "planEditGov");
                            c.setProjCode("");
                            planEditDao.updateCateEditDetailById(c);
                        }
                    }
                    queryList();
                    initStatus();
                    System.out.println("2******:!!!");
                }
                if (Null.check(list) && detailStatus == false) {
                    ToolKit.msgs_err("没有选择保存的内容，请重新修改保存!");
                    queryList();
                    initStatus();
                }
            }
        } else if (newBase) {
            try {
                checkFor(addli);
                System.out.println("detailStatus3:" + detailStatus);
                System.out.println("dataPeriod : " + base.getDataPeriod());
                if (!Null.check(list) && detailStatus == false) {
                    daom.startTransaction();
                    // dao.insert01(base, "planEditGov");
                    planEditDao.insertCateEditBase(base);
                    for (CateEditDetail a : list) {
                        a.setNumber(base.getNumber());
                        a.setCheckNumber("");
                        a.setEditDate(new Date());
                        if (Null.check(a.getProject().getFinCode())) {
                            a.getProject().setFinCode("");
                        }
                        if (!"0".equals(a.getStatus())) {
                            a.setStatus("0");
                        }
                        daom.startTransaction();
                        //dao.insert(a, "planEditGov");
                        planEditDao.insertCateEditDetail(a);
                        if (quality.equals("1")) {
                            //dao.update(a, "planEditGov");
                            planEditDao.updateCateEditDetailById(a);
                        }
                        if (quality.equals("0")) {
                            //dao.update01(a, "planEditGov");
                            a.setProjCode("");
                            planEditDao.updateCateEditDetailById(a);
                        }
                        daom.commitTransaction();
                    }
                    queryList();
                    initStatus();
                    addli = new ArrayList<CateEditDetail>();
                    System.out.println("3******:!!!");
                }
            } finally {
                daom.endTransaction();
            }
            newBase = false;
        }
    }

    public void checkFor(List<CateEditDetail> li) {
        detailStatus = false;
        list = new ArrayList<CateEditDetail>();
        for (CateEditDetail budget : initBudgetli) {
            for (CateEditDetail d : li) {
                if (d.isSelected() == true) {
                    if (budget.getId() == d.getId()) {
                        if (d.getCate().getCount() > budget.getCate().getCount()) {
                            ToolKit.msgs_err("计划数量不得大余预算数量!");
                            detailStatus = true;
                            break;
                        } else if (d.getFinancial() > budget.getFinancial()) {
                            ToolKit.msgs_err("计划财政性资金不得大余预算财政性资金!");
                            detailStatus = true;
                            break;
                        } else if (d.getOther() > budget.getOther()) {
                            ToolKit.msgs_err("计划其他资金不得大余预算其他资金!");
                            detailStatus = true;
                            break;
                        } else {
                            list.add(d);
                        }
                    }
                }
            }
        }
        System.out.println("list@@@:" + list.size());
    }

    public void selectdAll() {
        List<CateEditDetail> temp = (ArrayList) budgetModel.getWrappedData();
        List<CateEditDetail> budgetlist = new ArrayList<CateEditDetail>();
        if (temp != null && temp.size() > 0) {
            for (CateEditDetail l : temp) {
                l.setSelected(budgetall);
                budgetlist.add(l);
            }
            budgetModel.setWrappedData(budgetlist);
        }
    }

    public void selectdAllDetail() {
        List<CateEditDetail> temp = (ArrayList) detailModel.getWrappedData();
        List<CateEditDetail> dlist = new ArrayList<CateEditDetail>();
        if (temp != null && temp.size() > 0) {
            for (CateEditDetail l : temp) {
                l.setSelected(all);
                dlist.add(l);
            }
            detailModel.setWrappedData(dlist);
        }
    }

    public void addForPlan() {
        addli.clear();
        List<CateEditDetail> li = (ArrayList) budgetModel.getWrappedData();
        for (CateEditDetail c : li) {
            if (c.isSelected() == true) {
                addli.add(c);
            }
        }
        if (Null.check(addli)) {
            initStatus();
        }
    }
//    public void cancel() {
//        if (addOrUpdate) detail = new CateEditDetail();
//        initStatus();
//    }

    public void submitFor() throws SQLException {
        for (CateEditDetail d : detailli) {
            if (d.isSelected() == true) {
                if (!("0".equals(d.getStatus()) || "2".equals(d.getStatus()))) {
                    /*
                     * 0:未提交 2：退回修改
                     * 其他状态 跳过
                     */
                    continue;
                }
                d.setStatus("1");
                d.setCheckNumber("");
                planEditDao.updateCateEditDetailById(d);
                ToolKit.msgs_err("提交完成!");
            }
        }
        queryList();
        initStatus();
    }

    public void canclFor() throws SQLException {
        for (CateEditDetail d : detailli) {
            if (d.isSelected() == true) {
                if (!"1".equals(d.getStatus())) {
                    /*
                     * 不是提交状态的 跳过
                     */
                    continue;
                }
                /*
                 * 修改单据状态为 未提交
                 */
                d.setStatus("0");
                planEditDao.updateCateEditDetailById(d);
                ToolKit.msgs_err("撤单成功!");
            }
        }
        queryList();
        //editStatus = true;
        initStatus();
    }

    public void changeListener() {
        forButton = false;
        ToolKit.msgs_err("请单击查询");
    }

    private Person getCurPer() {
        return LoginParam.getPer();
    }
//     private Organization getCurOrg() {
//        return ToolKit.currentOrg();
//    }

    private Department getCurDept() {
        return LoginParam.getDept();
    }

    private String maxCode() {
        //Integer maxCode = (Integer) dao.query01(null, "planEditGov");
        Integer maxCode = planEditDao.queryMaxNumberFromBase();
        if (maxCode == null) {
            maxCode = 0;
        }
        return String.format(iyear + "YS-%08d%n", maxCode + 1).trim();
    }

    private Integer maxCodeId() {
        //Integer maxCodeId = (Integer) dao.query02(null, "planEditGov");
        Integer maxCodeId = planEditDao.queryMaxNumberFromDetail();
        if (maxCodeId == null) {
            maxCodeId = 0;
        }
        return maxCodeId + 1;
    }

    private Date getLoginDate() {
        return LoginParam.getLoginDate();
    }

    public Organization getOrg() {
        return org;
    }

    public void setOrg(Organization org) {
        this.org = org;
    }

    public Integer getIyear() {
        return iyear;
    }

    public void setIyear(Integer iyear) {
        this.iyear = iyear;
    }

    public List<Integer> getYearli() {
        return yearli;
    }

    public void setYearli(List<Integer> yearli) {
        this.yearli = yearli;
    }

    public List<SelectItem> getSelectNameli() {
        return selectNameli;
    }

    public void setSelectNameli(List<SelectItem> selectNameli) {
        this.selectNameli = selectNameli;
    }

    public List<SelectItem> getSessionli() {
        return sessionli;
    }

    public void setSessionli(List<SelectItem> sessionli) {
        this.sessionli = sessionli;
    }

    public Integer getIsession() {
        return isession;
    }

    public void setIsession(Integer isession) {
        this.isession = isession;
    }

    public Integer getIsessionFor() {
        return isessionFor;
    }

    public void setIsessionFor(Integer isessionFor) {
        this.isessionFor = isessionFor;
    }

    public CateEditBase getBase() {
        return base;
    }

    public void setBase(CateEditBase base) {
        this.base = base;
    }

    public CateEditDetail getDetail() {
        return detail;
    }

    public void setDetail(CateEditDetail detail) {
        this.detail = detail;
    }

    public List<CateEditDetail> getDetailli() {
        return detailli;
    }

    public void setDetailli(List<CateEditDetail> detailli) {
        this.detailli = detailli;
    }

    public DataModel<CateEditDetail> getDetailModel() {
        return detailModel;
    }

    public void setDetailModel(DataModel<CateEditDetail> detailModel) {
        this.detailModel = detailModel;
    }

    public boolean isAddOrUpdate() {
        return addOrUpdate;
    }

    public void setAddOrUpdate(boolean addOrUpdate) {
        this.addOrUpdate = addOrUpdate;
    }

    public boolean isEditStatus() {
        return editStatus;
    }

    public void setEditStatus(boolean editStatus) {
        this.editStatus = editStatus;
    }

    public boolean isNewBase() {
        return newBase;
    }

    public void setNewBase(boolean newBase) {
        this.newBase = newBase;
    }

    public boolean isForButton() {
        return forButton;
    }

    public void setForButton(boolean forButton) {
        this.forButton = forButton;
    }

    public List<FinancialProject> getProjList() {
        return projList;
    }

    public void setProjList(List<FinancialProject> projList) {
        this.projList = projList;
    }

    public DataModel<FinancialProject> getProjModel() {
        return projModel;
    }

    public void setProjModel(DataModel<FinancialProject> projModel) {
        this.projModel = projModel;
    }

    public String getQuality() {
        return quality;
    }

    public void setQuality(String quality) {
        this.quality = quality;
    }

    public Category getCate() {
        return cate;
    }

    public void setCate(Category cate) {
        this.cate = cate;
    }

    public List<String> getItemli() {
        return itemli;
    }

    public void setItemli(List<String> itemli) {
        this.itemli = itemli;
    }

    public List<CateEditDetail> getBudgetli() {
        return budgetli;
    }

    public void setBudgetli(List<CateEditDetail> budgetli) {
        this.budgetli = budgetli;
    }

    public DataModel<CateEditDetail> getBudgetModel() {
        return budgetModel;
    }

    public void setBudgetModel(DataModel<CateEditDetail> budgetModel) {
        this.budgetModel = budgetModel;
    }

    public boolean isAll() {
        return all;
    }

    public void setAll(boolean all) {
        this.all = all;
    }

    public boolean isBudgetall() {
        return budgetall;
    }

    public void setBudgetall(boolean budgetall) {
        this.budgetall = budgetall;
    }

    public List<CateEditDetail> getAddli() {
        return addli;
    }

    public void setAddli(List<CateEditDetail> addli) {
        this.addli = addli;
    }

    public List<CateEditDetail> getInitBudgetli() {
        return initBudgetli;
    }

    public void setInitBudgetli(List<CateEditDetail> initBudgetli) {
        this.initBudgetli = initBudgetli;
    }

    public boolean isDetailStatus() {
        return detailStatus;
    }

    public void setDetailStatus(boolean detailStatus) {
        this.detailStatus = detailStatus;
    }

    public List<CateEditDetail> getList() {
        return list;
    }

    public void setList(List<CateEditDetail> list) {
        this.list = list;
    }
}
